<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width"/>
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<title>Hello APP</title>
<link rel="stylesheet" type="text/css" href="../../css/aui-flex.css" />
<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
<style>
.aui-content{
	padding: 1rem;
}
.tit{
	font-size: 1.2rem;
	font-weight: bold;
}
.block{
	width: 0.3rem;
	height: 0.3rem;
	display: inline-block;
	background-color: #363335;
	margin-right: 0.2rem;
}
.pt-36{
	padding-top: 1.8rem;
}
.info-list{
	font-size: 0.7rem;
}
dl.comFlexItem dt {
		width: 5rem;
}
dl.comFlexItem{
	padding-top: 0.25rem;
}
select,
input.textInput {
		font-size: 0.7rem;
		height: 2rem;
}
.comFlexItem select,
.comFlexItem input.textInput {
		text-align: right;
		padding: 0 0.5rem;
}
.bom-tit{
	padding-top: 1.1rem;
	font-size: 0.6rem;
	color: #999999;
}
.comBox{
	position: fixed;
	bottom: 1rem;
	border-radius: 5rem;
	padding: 0 1rem;
	width: 100%;
}
.comBtmBtn{
	height: 2.5rem;
	line-height: 2.5rem;
	border-radius: 5rem;
}
</style>
</head>
<body>
	<div class="aui-content" id="zhuan">
		<div class="tit color-000">转账</div>

		<div class="info-list">
			<dl class="comFlexItem aui-border-b">
				<dt>转账金额</dt>
				<dd class="flex-auto"><input type="text" id="money" name="" value="" placeholder="请输入转账金额" class="textInput"></dd>
			</dl>
			<dl class="comFlexItem aui-border-b">
				<dt>对方ID</dt>
				<dd class="flex-auto"><input type="text" id="friendid" name="" value="" placeholder="请输入对方ID" class="textInput"></dd>
			</dl>
		</div>
		

	</div>
	<div class="comBox">
		<div class="comBtmBtn" tapmode onclick="save()">确定</div>
	</div>
</body>
<script type="text/javascript" src="../../script/import.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
var userId;
var userInfo;
userId = getUserId();
apiready = function(){
	api.parseTapmode();
	userId = getUserId();
	userInfo = getUserinfo();


};

userId = getUserId();
function save(){

	var money =$$('#money').val();
	var friendid = $$('#friendid').val();
	if(money==''){
		toast('请填写转账金额')
		return
	}
	if(friendid==''){
		toast('请填写对方ID')
		return
	}

	var postData = {};
	postData.money = money;
	postData.friendid = friendid;
	postData.userid = getUserId();
	console.log(JSON.stringify(postData))
	api.ajax({
			url: BASE_URL + 'App/Select/zhuanzhang',
			method: 'post',
			data: {
					values: postData
			}
	},function(ret, err){
		console.log(JSON.stringify(ret))
toast(ret.info)
			if (ret && ret.code == 1) {
					toast(ret.info);
					api.sendEvent({
							name: 'guanEvent'
					});
					setTimeout(function(){
						api.closeWin()
					},2000)

					// setTimeout(function(){
					// 	api.openWin({
					// 			name: 'index',
					// 			url: '../../index.html',
					// 			pageParam: {
					// 					name: name,
					// 					account: number
					// 			}
					// 			})
					// 	},500);

			}


	});



}
</script>
</html>
